<!DOCTYPE html>
<html>
<head>
	<title>data:数据绑定</title>
</head>
<body>
	<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
	<p>Apple</p>
	<p>MI</p>
	<p id="mz">Meizu</p>
	<script type="text/javascript">
		//data():绑定一个数组到选择集上，数组的各项值分别与选择集的各元素绑定,data() 比较常用
		var dataset=['I like dog','I like cat','I like snake'];
		var plist=d3.select('body').selectAll('p');
		plist.data(dataset);
		plist.text((value,index)=>{
			return value;
		})
		d3.select('#mz').style('color','red');//单独设置文字颜色
	</script>
</body>
</html>